#include "tcpserver.hpp"
#include "logger.h"

namespace moqi
{

TcpServer::TcpServer(const unsigned int& port, const string & ip):
_acceptor(port, ip),
_loop(_acceptor)
{

}

TcpServer::~TcpServer()
{

}

void TcpServer::start()
{
    LOG_INFO("TcpServer start");
    _acceptor.ready();
    _loop.loop();
}

void TcpServer::stop()
{
    LOG_INFO("TcpServer stop");
    _loop.unloop();
}

}//end of namespace moqi
